<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>键盘事件</title>
    <script src="vue.js"></script>
</head>

<script>
    window.onload = function(){
        new Vue({
            el:'#my',
            methods:{
                mykeydown:function(){
                    console.log('111');
                }
            }
        });
    }
</script>

<body>
    <div id="my">

        <!-- 键盘事件-->
        <input @keydown.13="mykeydown" value="enter" />
        <input @keydown.enter="mykeydown" value="enter" />
        <input @keydown.a="mykeydown" value="a" />
        <input @keydown.esc="mykeydown" value="esc" />
        <input @keydown.left="mykeydown" value="left" />

        <!--组合键-->
        <input @keydown.alt.67="mykeydown" value="alt+c" />
        <input @keydown.alt.c="mykeydown" value="alt+c" />
    </div>
</body>
</html>